package com.neusoft.controller;

import com.github.pagehelper.PageHelper;
import com.neusoft.entity.UmsAdmin;
import com.neusoft.service.UmsAdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 后台用户表(UmsAdmin)表控制层
 *
 * @author makejava
 * @since 2020-11-05 17:21:56
 */
@RestController
@RequestMapping("umsAdmin")
public class UmsAdminController {
    /**
     * 服务对象
     */
    @Resource
    private UmsAdminService umsAdminService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("queryById")
    public UmsAdmin queryById(Long id) {
        return this.umsAdminService.queryById(id);
    }

    @GetMapping("queryListByPage")
    public Object queryListByPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return umsAdminService.queryListByPage();
    }
}